package cn.anlaser.type;

public enum ImageTypeEnum {
	unknown("0", "未定"), shop("admin/shop", "商品"), product("admin/product", "商品"), brand(
			"admin/brand", "品牌"), origin("admin/origin", "产地"), article(
			"admin/article", "文章"), ad("admin/ad", "广告"), avatar(
			"admin/user", "用户头像"), category("admin/cat", "分类");
	private String code;
	private String title;

	ImageTypeEnum(String code, String title) {
		this.code = code;
		this.title = title;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public static ImageTypeEnum findByCode(String code) {
		for (ImageTypeEnum userKind : ImageTypeEnum.values()) {
			if (userKind.getCode().equals(code)) {
				return userKind;
			}
		}
		return null;
	}

}
